-- 预留
AddPlayerActivatedFunc(function(player, world)
    if not player:HasTag("battlesinger") then
        return
    end
    local INSPIRATION_BATTLESONG_DEFS = require("prefabs/battlesongdefs")
    player:ListenForEvent("inspirationdelta", function(inst)
        local classi = inst and inst.player_classified
        local value =  classi and classi.currentinspiration and classi.currentinspiration:value()
        local max = GLOBAL.TUNING.INSPIRATION_MAX
        local lines = GLOBAL.TUNING.BATTLESONG_THRESHOLDS
        
        if (not value) then
            return
        end

        local singed = {}
        for i=1,#lines do
            if value > (lines[i]*max + 1) then
                local songid = classi.inspirationsongs[i]:value()
                if songid == 0 then
                    local battlesongs = GetItemsFromAll(nil, "battlesong")
                    for _, battlesong in pairs(battlesongs)do
                        if not table.contains(singed, battlesong.prefab) and not str_contains(battlesong.prefab, "_instant_") then
                            local inventory = GLOBAL.ThePlayer.replica.inventory
                            if inventory then
                                inventory:UseItemFromInvTile(battlesong)
                                return TIP(GLOBAL.STRINGS.ACTIONS.SING, "PERU", battlesong.name)
                            end
                        end
                    end
                else
                    local song_def = INSPIRATION_BATTLESONG_DEFS.GetBattleSongDefFromNetID(songid)
                    if type(song_def) == "table" then
                        table.insert(singed, song_def.ITEM_NAME)
                    end
                end
            else
                break
            end
        end
    end)
end)